﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Smart
{
    public class Servis
    {
        Service.SoaService service;
        string serverName = Program.Session[Settings.Sunucu].ToString();
        string databaseName = Program.Session[Settings.Veritabani].ToString();
        string userName = Program.Session[Settings.VtKullaniciAdi].ToString();
        string password = Program.Session[Settings.VtSifre].ToString();

        public Servis()
        {
            service = new Smart.Service.SoaService();
            service.Timeout = 9999999;
            service.Url = Program.Session[Settings.ServiceUrl].ToString();
        }

        public string[] ExecuteScalar2(string serverName, string databaseName, string userName, string password, string ayrac, string sqlCommand)
        {
            try
            {
                return service.ExecuteScalar2(serverName, databaseName, userName, password, ayrac, sqlCommand);
            }
            catch (Exception ex)
            {
                ExceptionHandling.Hand(ex);
                return null;
            }
        }

        public bool EvrakEkle(string[] header, string[] details, string serverName, string databaseName, string userName, string password)
        {
            return service.EvrakEkle(header, details, serverName, databaseName, userName, password);
        }

        public bool TahsilatEkle(string[] Lines, string serverName, string databaseName, string userName, string password)
        {
            return service.TahsilatKayit(Lines, serverName, databaseName, userName, password);
        }
    }
}
